-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[ESQL] Shortcircuit grouping aggs on null value #129708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ESQL] Shortcircuit grouping aggs on null value #129708
Conversation
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| } | ||
|
|
||
| var intArray = blockFactory.bigArrays().newIntArray(totalValues); | ||
| for (int i = 0; i < block.getPositionCount(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a bug in the randomizer, which apparently wasn't triggering before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
luigidellaquila
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| } | ||
|
|
||
| var intArray = blockFactory.bigArrays().newIntArray(totalValues); | ||
| for (int i = 0; i < block.getPositionCount(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
Minor aggregators change plus a test to ensure we check that code path. We were doing a `value.isNull()` for each group the value had to be aggregated in, instead of doing it just once at the beginning. The affectation goes as follows: - 1 group, null value: We avoid some extra lightweight calls - N groups, null value: We avoid calling it N times - No groups, or non-null value: No effect
Minor aggregators change plus a test to ensure we check that code path. We were doing a `value.isNull()` for each group the value had to be aggregated in, instead of doing it just once at the beginning. The affectation goes as follows: - 1 group, null value: We avoid some extra lightweight calls - N groups, null value: We avoid calling it N times - No groups, or non-null value: No effect
Minor change plus a test to ensure we check that code path.
Basically, we were doing a
value.isNull()for each group the value had to be aggregated in, instead of doing it just once at the beginning.The affectation goes as follows:
I don't expect this to notably improve aggs, but it was something like a quick-win